/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-03-27
 * Time: 11:21
 */
public class test_2 {
    public static int calculateMinimumHP(int[][] dungeon) {
        int m = dungeon.length, n = dungeon[0].length;
        int[][] dp = new int[m + 1][n + 1];
        for(int j = 0; j <= n; j++) dp[m][j] = Integer.MAX_VALUE;
        for(int i = 0; i <= m; i++) dp[i][n] = Integer.MAX_VALUE;
        dp[m][n - 1] = dp[m - 1][n] = 1;
        for(int i = m - 1; i >= 0; i--)
            for(int j = n - 1; j >= 0; j--)
            {
                dp[i][j] = Math.min(dp[i][j + 1], dp[i + 1][j]) - dungeon[i][j];
                dp[i][j] = Math.max(dp[i][j], 1);
            }
        return dp[0][0];

    }
    public static void main(String[] args) {
            int a=8;
            int b=5;
        System.out.println(a>b ? a :b);
    }
}
